<?php
//前台公共控制器
class CommonController extends Controller{
	public function __init(){
		// print_const();
		if (!defined('__TEMPLATE__')) {
			define('__TEMPLATE__', __ROOT__ . '/Template/' . C('index_tpl_style'));
		}
		
	}
	protected function dis($tpl){
		$this->display(ROOT_PATH . 'Template/'.C('index_tpl_style'). '/' . $tpl);
	}

	/**
	 * [get_son 找子类]
	 * @param  [type] $cate [description]
	 * @param  [type] $cid  [description]
	 * @return [type]       [description]
	 */
	public function get_son($cate,$cid){
		$arr =array();
		foreach ($cate as  $v) {
			if($v["pid"]==$cid){
				$arr[]=$v;
				$arr =array_merge($arr,$this->get_son($cate,$v["cid"]));
			}
		}
		return $arr;
		
	}

}